from flask import Blueprint, render_template, url_for

errors_blueprint = Blueprint(
    'errors',
    __name__
)


@errors_blueprint.app_errorhandler(404)
def page_not_found(error):
    return render_template(
        'error.html',
        title=404,
        img='http://static5.piclab.org/image/bczd.jpg',
        album={'label': 'error', 'id': 0, 'fake': True},
    ), 404


@errors_blueprint.app_errorhandler(403)
def forbidden(error):
    return render_template(
        'error.html',
        title=403,
        img='http://static5.piclab.org/image/cry.jpg',
        album={'label': 'error', 'id': 0, 'fake': True},
    ), 403


@errors_blueprint.app_errorhandler(500)
def error_500(error):
    return render_template(
        'error.html',
        title=500,
        img='http://static5.piclab.org/image/cry.jpg',
        album={'label': 'error', 'id': 0, 'fake': True},
    ), 500
